# Introduction

[Wikipedia](https://en.wikipedia.org/wiki/Vala_(programming_language)) says:

> Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system. Vala is syntactically similar to C# and includes notable features such as anonymous functions, signals, properties, generics, assisted memory management, exception handling, type inference, and foreach statements.

To install:

```
# Debian:
sudo apt install valac
# Void Linux:
sudo xbps-install valac
# Arch Linux:
sudo pacman -S vala
```


More distros [here](https://wiki.gnome.org/Projects/Vala/ValaOnLinux).


The shortest example of a vala program I could find is:

```vala
void main () {
	print ("Hello World\n");
}
```

A more complex version of this with object oriented features would be:

```vala
class Sample: Object {
	void greeting () {
		stdout.printf ("Hello World\n");
	}

	static void main (string[] args) {
		var sample = new Sample ();
		sample.greeting ();
	}
}
```

Save it on a `test.vala` file, then run `valac test.vala`. This will give you a `test` binary file. Execute it with `./test` to see it running:

```bash
$ valac test.vala
$ ./test
Hello World
```
